#ifndef __OC_MapManager_H__
#define __OC_MapManager_H__

#include "ServerDef.h"
#include "OCMain/Singleton.h"
#include "OCMain/StringUtil.h"
#include "json/json.h"

namespace OCPP
{
	class _ServerExport MapManager : public CSingleton<MapManager>
	{
	public:
		~MapManager();
		static MapManager& getSingleton(void);
		static MapManager* getSingletonPtr(void);

		bool registerMap(const Json::Value& config);
		bool registerMap(String fileName, String ext);
		bool registerCacher(String fileName, String ext, String url, String path, StringVector subdomains);
		String getFileName(String layer);
		String getExt(String layer);
		String getMap(String layer, int z, int y, int x);
		String getMvt(String layer, int z, int y, int x);
		String get3dtiles(String layer,String path);
	private:
		void registerCacher(String fileName, String ext, const Json::Value& conf);
		String cacheIf(String layer, int z, int y, int x);
		String cacheIf(String layer, String path);
		StringMap _strExt;
		StringMap _strFile;

		//
		StringMap _strPath;

		MapCacherSet _mapCacherSet;
	};
}

#endif